﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ColdStorage.DOL
{
    
    class InternalLoad
    {
        Room rRoom = new Room();
        
        // Tính nhiệt do người tỏa ra

        int ipeopleNumber;

        public int iPeopleNumber
        {
            get { return ipeopleNumber; }
            set { ipeopleNumber = value; }
        }
        double dbengineCapacity;

        public double dbEngineCapacity
        {
            get { return dbengineCapacity; }
            set { dbengineCapacity = value; }
        }
        double dbenginePerformance;

        public double dbEnginePerformance
        {
            get { return dbenginePerformance; }
            set { dbenginePerformance = value; }
        }
        int iventilateMultiplecycle;

        public int iVentilateMultiplecycle
        {
            get { return iventilateMultiplecycle; }
            set { iventilateMultiplecycle = value; }
        }
        double dbairDensity;

        public double dbAirDensity
        {
            get { return dbairDensity; }
            set { dbairDensity = value; }
        }
        double dbfruitRespirationInput;

        public double dbFruitRespirationInput
        {
            get { return dbfruitRespirationInput; }
            set { dbfruitRespirationInput = value; }
        }
        double dbfruitRespirationStorage;

        public double dbFruitRespirationStorage
        {
            get { return dbfruitRespirationStorage; }
            set { dbfruitRespirationStorage = value; }
        }
        double dbairEnthalpyOutside;

        public double dbAirEnthalpyOutside
        {
            get { return dbairEnthalpyOutside; }
            set { dbairEnthalpyOutside = value; }
        }
        double dbairEnthalpyInside;

        public double dbAirEnthalpyInside
        {
            get { return dbairEnthalpyInside; }
            set { dbairEnthalpyInside = value; }
        }
        double dblightHeat;

        public double dbLightHeat
        {
            get { return dblightHeat; }
            set { dblightHeat = value; }
        }
        double dbdoorHeatFlowOpening;

        public double dbDoorHeatFlowOpening
        {
            get { return dbdoorHeatFlowOpening; }
            set { dbdoorHeatFlowOpening = value; }
        }
        double dbrespirationHeatFlowInput;

        public double dbRespirationHeatFlowInput
        {
            get { return dbrespirationHeatFlowInput; }
            set { dbrespirationHeatFlowInput = value; }
        }
        double dbrespirationHeatFlowStorage;

        public double dbRespirationHeatFlowStorage
        {
            get { return dbrespirationHeatFlowStorage; }
            set { dbrespirationHeatFlowStorage = value; }
        }


        //Tính nhiệt do người tỏa ra
        public int CalculatePeopleHeat()
        {
            return 350 * ipeopleNumber;
        }

        //Tính nhiệt do máy vận hành bên ngoài
        public double CalculateEngineHeatOut()
        {
            return 1000 * dbengineCapacity * dbenginePerformance;
        }
        //Tính nhiệt do máy vận hành bên trong
        public double CalculateEngineHeatIn()
        {
            return 1000 * dbengineCapacity ;
        }

        //Tính nhiệt do Chiếu sáng buồng

        public double CalculateLightingHeat(double dbroomArea)
        {
            return dbroomArea * dbLightHeat;
        }

        //Tính dòng nhiệt do mở cửa
        public double CalculateDoorOpening(double dbroomArea)
        {
            return dbroomArea * dbDoorHeatFlowOpening;
        }
    
        //Tính nhiệt do thông gió buồng lạnh
        public double CalculateVentialte(double dbroomVolume)
        {
            return ((dbroomVolume * iventilateMultiplecycle * dbairDensity) / (24 * 3600)) * (dbairEnthalpyInside * dbairEnthalpyOutside);           
        }

        // Tính dòng nhiệt do sản phẩm hô hấp
        public double CalculateFruitRespiration(double dbroomCapacity)
        {
            return dbroomCapacity * (0.1 * dbrespirationHeatFlowInput + 0.9 * dbrespirationHeatFlowStorage);
        }

    }
}
